-
Notifications
You must be signed in to change notification settings - Fork 121
Исправление ошибок в ролях и описании #3779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughBumps two 1c-syntax dependencies, changes preprocessor semantic-token grouping to merge leading Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 4❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (3)src/main/java/**/*.java📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/**/*.java📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/test/java/**/*Test.java📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-12-28T11:15:32.357ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Test Results 2 907 files ±0 2 907 suites ±0 1h 1m 8s ⏱️ + 2m 19s For more details on these failures, see this check. Results for commit f9ea57d. ± Comparison against base commit f4137ab. ♻️ This comment has been updated with latest results. |
...m/github/_1c_syntax/bsl/languageserver/context/symbol/description/MethodDescriptionTest.java
Outdated
Show resolved
Hide resolved
…cSemanticTokensSupplierTest Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
…emantic tokens supplier tests - BslDocSemanticTokensSupplierTest: use assertTokensMatch/assertContainsTokens with explicit tokens - CommentSemanticTokensSupplierTest: use assertTokensMatch for multiline test - LexicalSemanticTokensSupplierTest: use assertContainsTokens with explicit tokens - PreprocessorSemanticTokensSupplierTest: use assertTokensMatch, fix #Если to be single token - StringSemanticTokensSupplierTest: use assertTokensMatch instead of hasSize + assertContainsTokens - SymbolsSemanticTokensSupplierTest: use assertContainsTokens with explicit tokens Also fix PreprocessorSemanticTokensSupplier to combine # and keyword into single token for #Если, #КонецЕсли etc. Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
|
/buildJar |
|
✅ Собраны JAR-файлы для этого PR по команде Артефакт: 5152950316 Файлы внутри:
|
|
/buildJar |
|
✅ Собраны JAR-файлы для этого PR по команде Артефакт: 5152979827 Файлы внутри:
|
2. исправлен алгоритм вычисления областей в комментарии
2af58b9 to
040c135
Compare
…-tests' into feature/fixes260116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java`:
- Around line 424-443: The expected token line indices are off by one: the
comment tokens for " - ", "Число" and " - описание" belong to the same source
line containing "// Парам - Число - описание" and should use line 4 instead of
5, and the subsequent procedure/body/end tokens (the ExpectedToken entries
referencing "Процедура", "ДокТест", "(", "Парам", ")", the body comment "//
обычный комментарий", and "КонецПроцедуры") must all be shifted up one line as
well (decrement their line numbers by 1) so the ExpectedToken entries match the
actual source lines.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
build.gradle.ktssrc/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/PreprocessorSemanticTokensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/MethodDescriptionTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/CommentSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/LexicalSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/PreprocessorSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/StringSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SymbolsSemanticTokensSupplierTest.java
🚧 Files skipped from review as they are similar to previous changes (2)
- build.gradle.kts
- src/test/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/MethodDescriptionTest.java
🧰 Additional context used
📓 Path-based instructions (3)
src/main/java/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/PreprocessorSemanticTokensSupplier.java
src/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use Java 17 for language and follow Java naming conventions
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/PreprocessorSemanticTokensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/StringSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/CommentSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SymbolsSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/PreprocessorSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/LexicalSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
src/test/java/**/*Test.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)
Files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/StringSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/CommentSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SymbolsSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/PreprocessorSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/LexicalSemanticTokensSupplierTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
🧠 Learnings (2)
📓 Common learnings
Learnt from: theshadowco
Repo: 1c-syntax/bsl-language-server PR: 3610
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/folding/QueryPackageFoldingRangeSupplier.java:26-26
Timestamp: 2025-11-19T09:02:03.154Z
Learning: В проекте bsl-language-server используется кастомная версия ANTLR4 от 1c-syntax (io.github.1c-syntax:antlr4), которая включает базовый класс org.antlr.v4.runtime.Tokenizer с методами getAst() и getTokens(). SDBLTokenizer и BSLTokenizer наследуются от этого базового класса.
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-12-28T11:15:32.357Z
Learning: In PR `#3706` about semantic token optimization, I incorrectly stated that the algorithm in findSuffixMatchWithOffset correctly handles inline text insertions (text insertion without line breaks). The actual bug is that when lineOffset=0, tokens after the insertion point have the same deltaLine but different deltaStart, and the old algorithm failed to match them because it checked deltaStart equality. PR `#3707` fixes this by allowing deltaStart to differ for the boundary token when lineOffset==0.
📚 Learning: 2025-12-28T11:15:32.357Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-12-28T11:15:32.357Z
Learning: In PR `#3706` about semantic token optimization, I incorrectly stated that the algorithm in findSuffixMatchWithOffset correctly handles inline text insertions (text insertion without line breaks). The actual bug is that when lineOffset=0, tokens after the insertion point have the same deltaLine but different deltaStart, and the old algorithm failed to match them because it checked deltaStart equality. PR `#3707` fixes this by allowing deltaStart to differ for the boundary token when lineOffset==0.
Applied to files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: build
- GitHub Check: build (25, windows-latest)
- GitHub Check: build (25, macOS-latest)
- GitHub Check: build (25, ubuntu-latest)
- GitHub Check: build (17, ubuntu-latest)
- GitHub Check: build (21, macOS-latest)
- GitHub Check: build (17, windows-latest)
- GitHub Check: build (21, windows-latest)
- GitHub Check: build (21, ubuntu-latest)
- GitHub Check: build (17, macOS-latest)
- GitHub Check: Analyse
🔇 Additional comments (10)
src/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/LexicalSemanticTokensSupplierTest.java (2)
66-83: Clear test intent and correct expectations.The updated assertions correctly validate that lexical tokens include keywords/operators while excluding regular string tokens.
160-176: Accurate separation of responsibilities for query strings.The test now correctly asserts that query string content is handled elsewhere while keeping keyword/operator checks here.
src/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/CommentSemanticTokensSupplierTest.java (1)
135-147: Helper-based assertions look solid.Clear expected-token coverage for both multiline-disabled and multiline-enabled paths.
src/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/PreprocessorSemanticTokensSupplierTest.java (1)
101-108: Explicit token expectations match the new grouping behavior.Good alignment with the updated preprocessor tokenization logic.
src/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/StringSemanticTokensSupplierTest.java (1)
62-85: Helper-based assertions are consistent and clear.Good migration to
assertTokensMatchwith explicit expectations.Also applies to: 399-401
src/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SymbolsSemanticTokensSupplierTest.java (1)
60-104: Nice upgrade to explicit ExpectedToken checks.Improves clarity and consistency across symbol token tests.
Also applies to: 119-123
src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/PreprocessorSemanticTokensSupplier.java (1)
101-133: The code correctly handles preprocessor directives without duplication. Theuseandnativedirectives are separate top-level grammar rules, not children ofpreprocessor, so they are never processed byaddOtherPreprocs(). No guard is needed.src/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplierTest.java (3)
195-202: Clear, line-precise type expectations.Explicit ExpectedToken assertions for multiple types across lines are precise and improve coverage.
222-227: Good explicit checks for multiple return types.The ExpectedToken entries make the test intent and positions unambiguous.
243-265: Multiline vs single-line coverage is solid.Covering both modes with explicit ExpectedToken sets strengthens regression safety.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
...test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
Outdated
Show resolved
Hide resolved
…ct combined tokens (#3780) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.java (1)
209-225: Fix coordinate system inconsistency inaddBslDocTokensWithMultilineSupport.The multiline support method at lines 161 and 167 uses
lineIdx(relative index into the lines array) for lookups, butelementsByLineis keyed by file-absolute line numbers (element.line()). In contrast,addBslDocTokensPerLineat line 215 correctly usesfileLine(fileStartLine + lineIdx).When
fileStartLine != 0, the lookups at lines 161 and 167 will fail to find elements that are stored with file-absolute coordinates, causing tokens to be missed.Change both occurrences to use file-absolute line numbers:
var lineElements = elementsByLine.getOrDefault(fileLine, List.of()); // line 161 var nextLineElements = elementsByLine.getOrDefault(fileLine, List.of()); // line 167
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
🧰 Additional context used
📓 Path-based instructions (3)
src/main/java/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.java
src/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use Java 17 for language and follow Java naming conventions
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
src/test/java/**/*Test.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)
Files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
🧠 Learnings (2)
📓 Common learnings
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-12-28T11:15:32.357Z
Learning: In PR `#3706` about semantic token optimization, I incorrectly stated that the algorithm in findSuffixMatchWithOffset correctly handles inline text insertions (text insertion without line breaks). The actual bug is that when lineOffset=0, tokens after the insertion point have the same deltaLine but different deltaStart, and the old algorithm failed to match them because it checked deltaStart equality. PR `#3707` fixes this by allowing deltaStart to differ for the boundary token when lineOffset==0.
📚 Learning: 2025-12-28T11:15:32.357Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-12-28T11:15:32.357Z
Learning: In PR `#3706` about semantic token optimization, I incorrectly stated that the algorithm in findSuffixMatchWithOffset correctly handles inline text insertions (text insertion without line breaks). The actual bug is that when lineOffset=0, tokens after the insertion point have the same deltaLine but different deltaStart, and the old algorithm failed to match them because it checked deltaStart equality. PR `#3707` fixes this by allowing deltaStart to differ for the boundary token when lineOffset==0.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Analyse
- GitHub Check: build
- GitHub Check: Benchmark
- GitHub Check: build (17, ubuntu-latest)
- GitHub Check: build (25, ubuntu-latest)
- GitHub Check: build (25, macOS-latest)
- GitHub Check: build (21, windows-latest)
- GitHub Check: build (21, macOS-latest)
- GitHub Check: build (25, windows-latest)
- GitHub Check: build (21, ubuntu-latest)
- GitHub Check: build (17, windows-latest)
- GitHub Check: build (17, macOS-latest)
🔇 Additional comments (2)
src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java (2)
349-360: LGTM!The updated expected tokens correctly reflect the merged preprocessor directive behavior where
#and the following keyword are combined into a single Macro token. Token lengths and line positions are accurate.
388-443: Test expectations look correct.The expected tokens properly reflect the updated BSL sample with two leading lines. Line indices in
ExpectedTokenentries match the actual source positions:
- Line 0: plain comment (no Documentation modifier) ✓
- Line 2-4: documentation block with proper keyword/parameter/type highlighting ✓
- Line 5: procedure signature ✓
- Line 6: body comment (no Documentation modifier) ✓
- Line 7: end procedure ✓
Minor documentation nit: inline comments at lines 403-405 reference "Line 3", "Line 4" but the corresponding ExpectedTokens correctly use lines 2, 3, 4. This doesn't affect test correctness.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
|




Описание
Связанные задачи
Closes #3770
Closes #3772
Чеклист
Общие
gradlew precommit)Для диагностик
Дополнительно
Summary by CodeRabbit
Dependencies
Improvements
Tests
✏️ Tip: You can customize this high-level summary in your review settings.